package com.ruoyi.cnInnovation_compet.service.impl;

import java.util.List;

import com.ruoyi.common.annotation.DataScope;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.cnInnovation_compet.mapper.CnInnovationCompetMapper;
import com.ruoyi.cnInnovation_compet.domain.CnInnovationCompet;
import com.ruoyi.cnInnovation_compet.service.ICnInnovationCompetService;

/**
 * 创新大赛Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-11-13
 */
@Service
public class CnInnovationCompetServiceImpl implements ICnInnovationCompetService 
{
    @Autowired
    private CnInnovationCompetMapper cnInnovationCompetMapper;

    /**
     * 查询创新大赛
     * 
     * @param cicId 创新大赛主键
     * @return 创新大赛
     */
    @Override
    public CnInnovationCompet selectCnInnovationCompetByCicId(Long cicId)
    {
        return cnInnovationCompetMapper.selectCnInnovationCompetByCicId(cicId);
    }

    /**
     * 查询创新大赛列表
     * 
     * @param cnInnovationCompet 创新大赛
     * @return 创新大赛
     */
    @Override
    @DataScope(deptAlias = "d",userAlias = "d")
    public List<CnInnovationCompet> selectCnInnovationCompetList(CnInnovationCompet cnInnovationCompet)
    {
        return cnInnovationCompetMapper.selectCnInnovationCompetList(cnInnovationCompet);
    }

    /**
     * 新增创新大赛
     * 
     * @param cnInnovationCompet 创新大赛
     * @return 结果
     */
    @Override
    public int insertCnInnovationCompet(CnInnovationCompet cnInnovationCompet)
    {
        return cnInnovationCompetMapper.insertCnInnovationCompet(cnInnovationCompet);
    }

    /**
     * 修改创新大赛
     * 
     * @param cnInnovationCompet 创新大赛
     * @return 结果
     */
    @Override
    public int updateCnInnovationCompet(CnInnovationCompet cnInnovationCompet)
    {
        cnInnovationCompet.setUpdateTime(DateUtils.getNowDate());
        return cnInnovationCompetMapper.updateCnInnovationCompet(cnInnovationCompet);
    }

    /**
     * 批量删除创新大赛
     * 
     * @param cicIds 需要删除的创新大赛主键
     * @return 结果
     */
    @Override
    public int deleteCnInnovationCompetByCicIds(Long[] cicIds)
    {
        return cnInnovationCompetMapper.deleteCnInnovationCompetByCicIds(cicIds);
    }

    /**
     * 删除创新大赛信息
     * 
     * @param cicId 创新大赛主键
     * @return 结果
     */
    @Override
    public int deleteCnInnovationCompetByCicId(Long cicId)
    {
        return cnInnovationCompetMapper.deleteCnInnovationCompetByCicId(cicId);
    }
}
